import { RouteConfig } from 'vue-router';
import pageDetail from 'src/pages/article/_id.vue';

const routes: RouteConfig[] = [
  {
    path: '/',
    component: () => import('layouts/MainLayout.vue'),
    children: [{ path: '', component: () => import('pages/Index.vue') }]
  },

  {
    path: '/article',
    component: () => import('layouts/MainLayout.vue'),
    children: [
      // { path: ':id', component: () => import('pages/article/_id.vue') }
      { path: ':id', component: pageDetail }
    ]
  },
  {
    path: '/category',
    component: () => import('layouts/MainLayout.vue'),
    children: [
      {
        path: '',
        component: () => import('src/pages/category/index.vue')
      },
      {
        path: ':value',
        component: () => import('src/pages/category/result.vue')
      }
    ]
  },
  {
    path: '/tag',
    component: () => import('layouts/MainLayout.vue'),
    children: [
      {
        path: ':value',
        component: () => import('src/pages/tag/result.vue')
      }
    ]
  },
  {
    path: '/archive',
    component: () => import('layouts/MainLayout.vue'),
    children: [{ path: '', component: () => import('pages/archive.vue') }]
  },
  {
    path: '/about',
    component: () => import('layouts/MainLayout.vue'),
    children: [{ path: '', component: () => import('pages/about.vue') }]
  },
  {
    path: '/timeline',
    component: () => import('layouts/MainLayout.vue'),
    children: [{ path: '', component: () => import('pages/timeline.vue') }]
  },
  {
    path: '/music',
    component: () => import('layouts/MainLayout.vue'),
    children: [{ path: '', component: () => import('pages/music.vue') }]
  },
  {
    path: '/oauth',
    component: () => import('pages/oauth.vue')
  },
  // Always leave this as last one,
  // but you can also remove it
  {
    path: '*',
    component: () => import('pages/Error404.vue')
  }
];

export default routes;
